package net.yondervision.hrfsp.sdk.esign.domain.request;

import cn.hutool.http.Method;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import net.yondervision.hrfsp.sdk.esign.domain.AbstractESignRequest;
import net.yondervision.hrfsp.sdk.esign.domain.ESignRequest;
import net.yondervision.hrfsp.sdk.esign.domain.request.body.DocTemplatesSaveComponentsParamBody;
import net.yondervision.hrfsp.sdk.esign.domain.request.path.DocTemplatesSaveComponentsParamPath;
import net.yondervision.hrfsp.sdk.esign.domain.response.DocTemplatesComponentsResponse;

/**
 * @author Cash Zhang
 * @version v1.0
 * @since 2019/09/28 16:21
 */
@Data
@Builder
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class DocTemplatesSaveComponentsRequest extends AbstractESignRequest implements
    ESignRequest<DocTemplatesComponentsResponse> {

  private DocTemplatesSaveComponentsParamPath docTemplatesSaveComponentsParamPath;
  private DocTemplatesSaveComponentsParamBody docTemplatesSaveComponentsParamBody;

  public DocTemplatesSaveComponentsRequest(
      DocTemplatesSaveComponentsParamPath docTemplatesSaveComponentsParamPath,
      DocTemplatesSaveComponentsParamBody docTemplatesSaveComponentsParamBody) {
    this.docTemplatesSaveComponentsParamPath = docTemplatesSaveComponentsParamPath;
    this.docTemplatesSaveComponentsParamBody = docTemplatesSaveComponentsParamBody;
    this.setParamPath(docTemplatesSaveComponentsParamPath);
    this.setParamBody(docTemplatesSaveComponentsParamBody);
  }

  @Override
  public String getUrl() {
    return "/docTemplates/{templateId}/components";
  }

  @Override
  public Method getMethodType() {
    return Method.POST;
  }


  @Override
  public Class<DocTemplatesComponentsResponse> getResponseClass() {
    return DocTemplatesComponentsResponse.class;
  }

}
